<?php

namespace app\news\controller;

use think\Db;



use think\Hook;
use GuzzleHttp\json_decode;

/**
 * @title 公告信息
 */
use app\common\controller\Frontend;

class Index extends Frontend
{

	    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

	
	//首页
	public function index(){
		$news = db::name('news')
			->order('id desc')
			->paginate();
		$this->assign('news',$news);
		return $this->fetch(); // 渲染模板
		
	}
	
	
	//新闻详情
	public function newsdetails(){
	    $id = request()->param('id');
	    $news = db::name('news')
	    ->find($id);

	    
	    //$news['content']=str_replace("/uploads/images/", "http://adm.shigood.com/uploads/images/", $news['content']);
	    $this->assign('article',$news);
	    return $this->fetch(); // 渲染模板
	}

    //新闻详情
	public function details(){
		$id = request()->param('id');
		$news = db::name('web_news_organization')
			->find($id);
		//$news['content']=str_replace("/uploads/images/", "http://adm.shigood.com/uploads/images/", $news['content']);
		$this->assign('article',$news);
		return $this->view->fetch(); // 渲染模板
	}
	
	
	
	//新闻详情
	public function gk_guide_details(){
	    $id = $this->request->param('id');
	    $news = db::name('gk_guide')
	    ->find($id);
	    
	    
	    $news['content']=str_replace("/uploads/images/", "http://adm.shigood.com/uploads/images/", $news['content']);
	    $this->assign('article',$news);
	    return $this->fetch(); // 渲染模板
	}
	    //小程序合作单位静态页面
	public function wechat(){
		return $this->fetch(); // 渲染模板
	}
	

}
